<template>
  <div class="common-layout">
    <el-container>
      <el-header>
        <div class="header">
          <img src="https://logomakerr.ai/img/logo-icons/logomakerr-white.svg" alt="">
        </div>
      </el-header>
      <el-container>
        <el-aside width="360px">
          <div class="aside">
            <div class="aside-title">Symbol suggestions</div>
            <div class="aside-container" v-for="(item, index) in aside" :key="index">
              <div class="aside-item">{{ item }}{{ index }}</div>
            </div>
          </div>
        </el-aside>
        <el-main>
          <div class="main">
            <div class="main-item-top">
              <div v-for="(item, index) in toolButton" :key="index">
                <div class="tooltip-base-box">
                  <div class="row center">
                    <el-tooltip class="box-item" effect="dark" :content=item.tool placement="top">
                      <div class="tool-button">
                        <img :src="require(`@/assets/iconImag/${item.icon}`)" alt="">
                        {{ item.title }}
                      </div>
                    </el-tooltip>
                  </div>
                </div>
              </div>
            </div>
            <div class="main-item-center">
              <div class="container-canvas">画布</div>
            </div>
            <div class="main-item-end">
              <div class="commercial-container" v-for="(item, index) in commercialButton" :key="index">
                <div class="commercial-button" :id=index>
                  <img :src="require(`@/assets/iconImag/${item.icon}`)" alt="">
                  {{ item.title }}
                </div>
              </div>
            </div>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup name="HelloWorld">
import { ref, onMounted } from 'vue'
const aside = ref(["素材", "图标", "字体", "模板", "设计", "插画", "视频", "3D", "AI", "工具", "灵感", "活动", "更多"]);
const toolButton = ref([
  { title: "Symbols", tool: "Suggest new symbols", icon: "function.png" },
  { title: "Layout", tool: "Suggest new layouts", icon: "cycle.png" },
  { title: "Fonts", tool: "Suggest new fonts", icon: "A.png" },
  { title: "Colors", tool: "Suggest new colors", icon: "color.png" },
]);
const commercialButton = ref([
  { title: "Primary", icon: "FullScreen.png" },
  { title: "Success", icon: "save.png" },
  { title: "Danger", icon: "ShoppingCart.png" },
]);
const initSytle = () => {
  let el1 = window.document.getElementById("0");
  let el2 = window.document.getElementById("1");
  let el3 = window.document.getElementById("2");
  el1.style.color = "#20a0ff";
  el2.style.color = "#0d9532";
  el3.style.color = "#ff742e";
};
onMounted(() => {
  initSytle();
})
</script>

<style scoped>
header {
  margin: 0;
  padding: 0;
  height: 50px;
  background-color: #1a1323;
}

.header {
  margin: 0;
  padding: 0 20px;
  line-height: 50px;
  display: flex;
  align-items: center;
}

.header img {
  height: 30px;
  width: auto;
  display: block;
}

.aside {
  height: calc(100vh - 50px);
  padding: 0 20px;
  background-color: #fffefe;
  overflow-y: scroll;
}

.aside-title {
  height: 55px;
  line-height: 55px;
  font-size: 18px;
  font-weight: 500;
  color: rgb(51, 51, 51);
}

.aside-container {
  padding: 8px 0;
  height: 220px;
  line-height: 220px;
  color: white;
}

.aside-item {
  background-color: #1a1323;
  border-radius: 5px;
}

main {
  padding: 0;
  margin: 0;
}

.main {
  background-color: #f7f7f7;
  height: calc(100vh - 50px);
  width: calc(100vw - 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.main-item-top {
  padding-bottom: 20px;
  height: 105px;
  width: 100%;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: self-end;
}

.main-item-center {
  flex-grow: 1;
  width: 100%;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container-canvas {
  background-color: #1a1323;
  height: 100%;
  width: 630px;
  border-radius: 8px;
  overflow: hidden;
}

.main-item-end {
  padding-top: 20px;
  height: 105px;
  width: 100%;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: self-start;
}

.tool-button {
  width: 140px;
  height: 40px;
  text-align: center;
  line-height: 40px;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  font-weight: bold;
  margin: 0 10px;
}

.tool-button>img {
  width: 15px;
  height: 15px;
}

.tool-button:hover {
  color: rgb(83 64 255)
}

.commercial-container {
  width: 150px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.commercial-button {
  width: 110px;
  height: 42px;
  text-align: center;
  line-height: 40px;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  font-weight: bold;
  border-radius: 50px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
  transition: width 0.3s, height 0.3s, font-size 0.3s;

  margin: 0 10px;
}

.commercial-button>img {
  width: 14px;
  height: 14px;
}

.commercial-button:hover {
  width: 125px;
  height: 48px;
  font-size: 16px;

  img {
    width: 16px;
    height: 16px;
  }
}
</style>
